/***************************************************************************
 *   Copyright (C) 2008 by Eduardo Gurgel Pinho                            *
 *   edgurgel@gmail.com                                                    *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 3 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
***************************************************************************/

#ifndef __INPUT_H__
#define __INPUT_H__

#include "scene.h"
#include "raytracing/raytracer.h"
#include "camera.h"

#include <boost/serialization/nvp.hpp>

namespace Sirat {

namespace Common {
	
struct Rendering_Scene {
	Rendering_Scene() { }
	Ray_Tracing::Raytracer* raytracer;
	Camera* camera;	
	Scene* scene;
private:
	friend class boost::serialization::access;
	template<class Archive> void serialize(Archive&, const unsigned int);         
};

template<class Archive> void Rendering_Scene::serialize(Archive& ar, const unsigned int /* file_version */){
	ar & BOOST_SERIALIZATION_NVP(raytracer)
		& BOOST_SERIALIZATION_NVP(camera)
		& BOOST_SERIALIZATION_NVP(scene);
}

class Input {
	
public:
	Input(const char*);
	Input();
	~Input();

	void parse();
	void parse(const char*);
	void save();
	void save(Ray_Tracing::Raytracer*,Scene*,Camera*,const char*);

	Scene* get_scene() const;
	Ray_Tracing::Raytracer* get_raytracer() const;
	Camera* get_camera() const;
private:
	Rendering_Scene rendering_scene;
	const char* file;
};

}

}

#endif
